﻿using System;
using DapperExtensions.Mapper;
using Newtonsoft.Json;

namespace ZilLion.Service.WeChatMall.Domain.Entitys.GsInfo
{
    public class GsGroupEntity
    {
        /// <summary>
        ///     组id
        /// </summary>
        [JsonProperty("groupid")]
        public long GroupId { get; set; }

        /// <summary>
        ///     纵联商城接入关键字
        /// </summary>
        [JsonProperty("zlcompanykey")]
        public string ZlCompanyKey { get; set; }

        /// <summary>
        ///     组设置名称
        /// </summary>
        [JsonProperty("groupname")]
        public string GroupName { get; set; }

        /// <summary>
        ///     分组类型（用于显示前端图标）
        /// </summary>
        [JsonProperty("grouptype")]
        public string GroupType { get; set; }

        /// <summary>
        ///     原价
        /// </summary>
        [JsonProperty("groupsn")]
        public int GroupSn { get; set; }

        /// <summary>
        ///     修改时间
        /// </summary>
        [JsonProperty("updatedtime")]
        public DateTime UpdatedTime { get; set; }

        /// <summary>
        ///     修改人
        /// </summary>
        [JsonProperty("updater")]
        public long Updater { get; set; }
    }

    public class GsGroupEntityMapper : ClassMapper<GsGroupEntity>
    {
        public GsGroupEntityMapper()
        {
            Table("gsgroupinfo");
            Map(f => f.GroupId).Column("groupid").Key(KeyType.Assigned);
            Map(f => f.ZlCompanyKey).Column("zlcompanykey");
            Map(f => f.GroupName).Column("groupname");
            Map(f => f.GroupType).Column("grouptype");
            Map(f => f.GroupSn).Column("groupsn");
            Map(f => f.UpdatedTime).Column("updatedtime");
            Map(f => f.Updater).Column("updater");
        }
    }
}